package com.yonyou.pmclouds.plan.planindex.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import com.yonyou.pmclouds.ApplicationConsts;
import com.yonyou.pmclouds.basecom.exception.BusinessException;
import com.yonyou.pmclouds.plan.planindex.entity.PlanIndexVO;
import com.yonyou.pmclouds.plan.planindex.rmiitf.IPlanIndexQuery;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author th
 * @date 2019/11/14 14:46
 */
@RestController
@RequestMapping("/planIndex")
public class PlanIndexController {
    @Reference(version = ApplicationConsts.APPLICATION_VERSION)
    private IPlanIndexQuery query;

    /**
     * 查询计划关联的指标
     *
     * @param pkPlan
     * @return
     * @throws BusinessException
     */
    @RequestMapping("/queryIndexOfPlan")
    public List<PlanIndexVO> queryIndexOfPlan(@RequestParam("pkPlan") String pkPlan) throws BusinessException {
        List<PlanIndexVO> result = query.queryIndexOfPlan(pkPlan);
        return result;
    }

}
